/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		EditControl.h

					E-mail:		arise_engine@mail.ru

					Origin by:	guiapp (c)

created:			21.09.2008
last changes:		22.09.2008
*****************************************************************************************/
#pragma once
#include "GuiObject.h"

#define EDIT_CONTROL_MAX_CHARACTERS		1024


class EditControl: public GuiObject
{
public:
	EditControl();

	DWORD			textColor;
	Font*			m_Font;
	//bool			m_Focus;
	int				m_Pos;
	int				m_char_limit;
	char			m_Text[EDIT_CONTROL_MAX_CHARACTERS];
	float			m_Time;
	bool			m_Blink;
	
	virtual void	Init(int id, float x, float y, float w, Font *fnt, char* str = "");
	virtual void	Render();
	virtual void	Selected(bool bDown);
	virtual bool	KeyClick(int key, int character);
	virtual void	Update(float dt);
	virtual void	Move(float dx, float dy );
	
	virtual void	SetTextColor(DWORD clr) {textColor = clr;}
	virtual void	SetText(const std::string text);	

	virtual const char*	GetText(){return m_Text;}


};

